import axios from "../package/axios/axios.min.js";
import StorageUtil from '../utils/StorageUtil';
export const service = axios.create({
  baseURL: '//192.168.2.1',
  timeout: 30000
})

service.interceptors.request.use(
  async config => {
    const auth = StorageUtil.get('auth')
    config.params = {
      ...config.params,
      ...auth,
    }
    config.headers.uid = auth?.uid
    config.headers.ticket = auth?.ticket
    return config
  },
  error => {
    return Promise.reject(error)
  }
)